*Replication code for the 2025 post-pandemic study in "Recocking with Reality: Correcting National Overconfidence in a Rising Power" by Haifeng Huang

*Prepared in August 2025


/****** Variables

pew: respondents' answers about the Pew survey result
pewus: respondents' answers about the US result in the Pew survey
gallup: respondents' answers about Gallup World Poll result
taiwan: respondents' answers about the Taiwan poll result
lapop: respondents' answers about the Latin America survey result
iseas: respondents' answers about the Southeast Asia survey result
selfimage2: national self-image; = pew + gallup + lapop + iseas + taiwan 
selfimage2_sc= selfimage2/500 

female: 0 or 1
age: age
age_sc: age group rescaled to range from 0 to 1
education: current education level 
education_sc: education level rescaled to range ranging from 0 to 1 
familyincome: family income level
familyincome_sc: family income status rescaled to range from 0 to 1
life: life satisfaction
life_sc: life satisfaction rescaled to range from 0 to 1
pinterest: political interest
pinterest_sc: political interest rescaled to range from 0 to 1
pknowledge: US political knowledge
pknowledge_sc: US political knowledge rescaled to range from 0 to 1
numstates: number of US states visited, ranging from 1 (1 state) to 6 (16 and above)
numstates_sc: number of US states visited rescaled to range from 0 to 1
numcountries: number of countries (excluding China) visited, ranging from 1 (1 country) to 6 (16 and above)
numcountries_sc: number of countries visited rescaled to range from 0 to 1 
usyears: number of years in the US
usyears_sc: usyears rescaled to range from 0 to 1 

cnmsmedia_cn2: Chinese mainstream media as a major information source (0 or 1)
cnssmedia_cn2: Chinese social media as a major information source (0 or 1)
overseasmsmedia_cn2: foreign mainstream media as a major information source (0 or 1)
overseasssmedia_cn2: foreign social media as a major information source (0 or 1)
overseascnmedia_cn2: o media as a major information source (0 or 1)
personalcommunication: interpersonal communication as a major information source (0 or 1)

treatment: treated (0 or 1)

righttract: agreement with the statement that China is on a right track
righttract_sc: righttract rescaled to range from 0 to 1
cncentury: agreement with the statement that the 21st century is a Chinese century
cncentury_sc: cncentury rescaled to range from 0 to 1

mycountry: whether China is a better country than most other countries
mypeople: whether the world would be a better place if people from other countries are more like people from China
cnsports: how proud one feels when Chinese athletes win in international sports
citizenship: whether one will choose Chinese citizenship over any other citizenship in the world
nationalism: (mycountry + mypeople + cnsports + citizenship)/4
nationalism_sc: nationalism rescaled to range from 0 to 1

******/




********** Figure 7 **********


clear

use overconfidence2025.dta


* sum pew pewus gallup lapop iseas taiwan, detail 

grstyle init
grstyle set plain
grstyle color background white
grstyle clockdir legend_position 12
grstyle linestyle legend none

***

hist pew, xline(35, lcolor(red) lpattern(solid)) xlabel(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%") xtitle("(A) Pew 2024 (35 Countries): Positive Views of China", margin(small)) bcolor(gray) text(.044 34.7 "correct: 35%", place(w) color(black)) xline(40, lcolor(black) lpattern(solid)) text(0.044 40.3 "median: 40%", place(e) color(black))

graph save 2025_pew, replace

***

hist pewus, xline(16, lcolor(red) lpattern(solid)) xlabel(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%") xtitle("(B) Pew 2024 (USA): Positive Views of China", margin(small)) bcolor(gray) text(.044 16 "correct: 16%", place(w) color(black)) xline(38, lcolor(black) lpattern(solid)) text(0.044 38.3 "median: 38%", place(e) color(black))

graph save 2025_pewus, replace

***

hist lapop, xline(36.6, lcolor(red) lpattern(solid)) xlabel(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%") xtitle("(D) Latin America (2023): Trust in China", margin(small)) bcolor(gray) text(.045 36 "correct: 36.6%", place(w) color(black)) xline(45, lcolor(black) lpattern(solid)) text(0.045 45.5 "median: 45%", place(e) color(black))

graph save 2025_lapop, replace

***

hist iseas, xline(24.8, lcolor(red) lpattern(solid)) xlabel(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%") xtitle("(C) Southeast Asia (2024): Confidence in China's Global Role") bcolor(gray) text(.042 24.3 "correct: 24.8%", place(w) color(black)) xline(50, lcolor(black) lpattern(solid)) text(0.042 50.5 "median: 50%", place(e) color(black))

graph save 2025_iseas, replace

***

hist gallup,  xline(30, lcolor(red) lpattern(solid))  xlabel(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%") xtitle("(E) World (2024): Approval of China's Leadership", margin(small)) bcolor(gray) text(.041 30 "correct: 30%", place(w) color(black)) xline(40, lcolor(black) lpattern(solid)) text(0.041 40.3 "median: 40%", place(e) color(black))

graph save 2025_gallup, replace

***

hist taiwan, xline(6.1, lcolor(red) lpattern(solid)) xlabel(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%")  xtitle("(F) Taiwan (2024): Support for Reunification with Mainland China", margin(small)) bcolor(gray) text(.044 6.2 "correct: 6.1%", place(e) color(black)) bin(34) xline(30, lcolor(black)lpattern(solid)) text(0.044 30.3 "median: 30%", place(e) color(black))

graph save 2025_taiwan, replace

***

graph combine 2025_pew.gph 2025_pewus.gph 2025_iseas.gph 2025_lapop.gph  2025_gallup.gph  2025_taiwan.gph, rows(3)

graph save 2025_selfimage, replace

grstyle clear



            

********** Figure 8 *********


clear
use overconfidence2025.dta

grstyle init
grstyle set plain
grstyle color background white
grstyle clockdir legend_position 6
grstyle linestyle legend none


eststo rt:  quietly reg righttrack_sc treatment selfimage2_sc female age_sc education_sc familyincome_sc life_sc  pinterest_sc cnmsmedia_cn2 cnssmedia_cn2 overseasmsmedia_cn2 overseasssmedia_cn2 overseascnmedia_cn2 personalcommunication_cn2 pknowledge_sc numstates_sc numcountries_sc usyears_sc, robust   

eststo cc:  quietly reg cncentury_sc treatment selfimage2_sc female age_sc education_sc familyincome_sc life_sc  pinterest_sc cnmsmedia_cn2 cnssmedia_cn2 overseasmsmedia_cn2 overseasssmedia_cn2 overseascnmedia_cn2 personalcommunication_cn2 pknowledge_sc numstates_sc numcountries_sc usyears_sc, robust   

eststo nt:  quietly reg nationalism_sc treatment selfimage2_sc female age_sc education_sc familyincome_sc life_sc  pinterest_sc cnmsmedia_cn2 cnssmedia_cn2 overseasmsmedia_cn2 overseasssmedia_cn2 overseascnmedia_cn2 personalcommunication_cn2 pknowledge_sc numstates_sc numcountries_sc usyears_sc, robust  


coefplot(rt, msymbol(O) mcolor(black)), bylabel(Right Track) || ///
 (cc), bylabel(Chinese Century) || ///
  (nt), bylabel(Nationalism) ||,  ///
keep(treatment) ///
xline(0, lpattern(dash) lcolor(black) lwidth(thin))  byopts(compact) bycoefs ///
	    levels(90 95) ciopts(lwidth(*3 *1) lcolor(red blue)) ///
legend(order(1 "90% CI" 2 "95% CI") rows(1)) 

graph save 2025_treat.gph, replace 

grstyle clear
 
eststo clear





********* Table A10 *******


clear

use overconfidence2025.dta

ttest selfimage2, by(treatment) unequal 
ttest female, by(treatment) unequal 
ttest age, by(treatment) unequal 
ttest education, by(treatment) unequal 
ttest familyincome, by(treatment) unequal 
ttest life, by(treatment) unequal 
ttest pinterest, by(treatment) unequal 

ttest cnmsmedia_cn2, by(treatment) unequal 
ttest cnssmedia_cn2, by(treatment) unequal 
ttest overseasmsmedia_cn2, by(treatment) unequal 
ttest overseasssmedia_cn2, by(treatment) unequal 
ttest overseascnmedia_cn2, by(treatment) unequal 
ttest personalcommunication_cn2, by(treatment) unequal 

ttest pknowledge, by(treatment) unequal 
ttest numstates, by(treatment) unequal 
ttest numcountries, by(treatment) unequal 
ttest usyears, by(treatment) unequal 





********** Table A11 *********


clear
use overconfidence2025.dta

grstyle init
grstyle set plain
grstyle color background white
grstyle clockdir legend_position 6
grstyle linestyle legend none


eststo rt:  quietly reg righttrack_sc treatment selfimage2_sc female age_sc education_sc familyincome_sc life_sc  pinterest_sc cnmsmedia_cn2 cnssmedia_cn2 overseasmsmedia_cn2 overseasssmedia_cn2 overseascnmedia_cn2 personalcommunication_cn2 pknowledge_sc numstates_sc numcountries_sc usyears_sc, robust   

eststo cc:  quietly reg cncentury_sc treatment selfimage2_sc female age_sc education_sc familyincome_sc life_sc  pinterest_sc cnmsmedia_cn2 cnssmedia_cn2 overseasmsmedia_cn2 overseasssmedia_cn2 overseascnmedia_cn2 personalcommunication_cn2 pknowledge_sc numstates_sc numcountries_sc usyears_sc, robust   

eststo nt:  quietly reg nationalism_sc treatment selfimage2_sc female age_sc education_sc familyincome_sc life_sc  pinterest_sc cnmsmedia_cn2 cnssmedia_cn2 overseasmsmedia_cn2 overseasssmedia_cn2 overseascnmedia_cn2 personalcommunication_cn2 pknowledge_sc numstates_sc numcountries_sc usyears_sc, robust  


esttab using 2025_treat.tex, replace b(3) se(3) ar2 label star(+ 0.1 * 0.05 ** 0.01 *** 0.001) booktabs compress title(Treatment Effects in the Post-Pandemic Study \label{tab: 2025_treat})
 
eststo clear




*****

clear

exit
